#define _CRT_SECURE_NO_WARNINGS 1

class Solution
{
    vector<vector<int>> ret;
    vector<int> path;

public:
    vector<vector<int>> subsets(vector<int>& nums)
    {
        dfs(nums, 0);
        return ret;
    }

    void dfs(vector<int>& nums, int i)
    {
        if (i == nums.size())
        {
            ret.push_back(path);
            return;
        }

        dfs(nums, i + 1);

        path.push_back(nums[i]);

        dfs(nums, i + 1);
        path.pop_back();
        return;
    }
};